home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / dev / lang / amigatalk.lha / intuition / BoopsiSliderTags.st < prev    next >
Text File  |  2002-05-07  |  3KB  |  85 lines

  1. " --------------------------------------------------------------------- "
  2. " BoopsiSliderTags Class is a Singleton class that allows the user      "
  3. " to reference BOOPSI Slider class tags' hexadecimal values.            "
  4. ""
  5. "  EXAMPLE:  'myTag <- sliderTags getTag: #SLIDER_Level'                "
  6. ""
  7. " ALL singleton classes MUST contain the following:                     "
  8. "" 
  9. "  the methods:  isSingleton AND privateSetup     AND                   "
  10. "                 uniqueInstance Class instance variable.               "
  11. " --------------------------------------------------------------------- "
  12.  
  13. Class BoopsiSliderTags :Dictionary ! uniqueInstance !
  14. [
  15.    isSingleton
  16.      ^ true  
  17. |  
  18.    privateNew ! newinstance !
  19.      newinstance <- super new.
  20.  
  21.      ^ newinstance
  22. |
  23.    new
  24.      ^ self privateSetup
  25. |
  26.    getTag: tagKey
  27.      ^ self at: tagKey
  28. |
  29.    privateInitializeDictionary
  30.  
  31.      self at: #SLIDER_Min           put: 16r85028001. " (WORD) . "
  32.  
  33.      self at: #SLIDER_Max           put: 16r85028002. " (WORD) . "
  34.  
  35.      self at: #SLIDER_Level         put: 16r85028003. " (WORD) . "
  36.  
  37.      self at: #SLIDER_Orientation   put: 16r85028004. " (WORD) . "
  38.  
  39.      " (struct Hook *) A0 Hook, A2 Object, A1 TagList
  40.      * containing SLIDER_Level, SLIDER_ Min, SLIDER_Max, 
  41.      * GA_ID, GA_UserInput. 
  42.      "
  43.      self at: #SLIDER_DispHook      put: 16r85028005.
  44.  
  45.      self at: #SLIDER_Ticks         put: 16r85028006. " (LONG) . "
  46.  
  47.      self at: #SLIDER_ShortTicks    put: 16r85028007. " (BOOL) . "
  48.  
  49.      self at: #SLIDER_TickSize      put: 16r85028008. " (WORD) . "
  50.  
  51.      self at: #SLIDER_KnobImage     put: 16r85028009. " (struct Image *) . "
  52.  
  53.      self at: #SLIDER_BodyFill      put: 16r8502800A. " (WORD) . "
  54.  
  55.      self at: #SLIDER_BodyImage     put: 16r8502800B. " (struct Image *) . "
  56.  
  57.      " (BOOL) Gradient slider model, defaults to false. "
  58.      self at: #SLIDER_Gradient      put: 16r8502800C.
  59.  
  60.      " (UWORD *) Pens for gradient slider. "
  61.      self at: #SLIDER_PenArray      put: 16r8502800D.
  62.  
  63.      " (BOOL) Flip Min/Max positions. Defaults to false. "
  64.      self at: #SLIDER_Invert        put: 16r8502800E.
  65.  
  66.      self at: #SLIDER_KnobDelta     put: 16r8502800F. " (WORD) . "
  67.  
  68.      " SLIDER_Orientation Modes "
  69.  
  70.      self at: #SORIENT_HORIZ        put: 2. " FREEHORIZ "
  71.      self at: #SORIENT_VERT         put: 4. " FREEVERT  "
  72.  
  73.      self at: #SLIDER_HORIZONTAL    put: 2. 
  74.      self at: #SLIDER_VERTICAL      put: 4.
  75. |
  76.    privateSetup
  77.      (uniqueInstance isNil)
  78.        ifTrue: [uniqueInstance <- self privateNew.
  79.                 
  80.                 self privateInitializeDictionary.
  81.                ].
  82.                
  83.      ^ self    "or ^ uniqueInstance??"
  84. ]
  85.